﻿using SHRIS.MIS.Entity.ScadaData;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace SHRIS.MIS.Entity.ScadaBaseInfo
{
    [Table("tb_dataSource")]
    public class DataSourceEntity
    {
        /// <summary>
        /// 数据源唯一ID
        /// </summary>
        [Key]
        [Column("DataSourceId")]
        public Guid Id { get; set; }

        /// <summary>
        /// 服务器ID
        /// </summary>
        [Required]
        public Guid ServerId { get; set; }

        /// <summary>
        /// 数据源IP
        /// </summary>
        [Required]
        public string SourceIp { get; set; }

        /// <summary>
        /// 数据源端口
        /// </summary>
        [Required]
        public int SourcePort { get; set; }

        /// <summary>
        /// 协议类型
        /// </summary>
        [Required]
        public int ProtocalType { get; set; }

        /// <summary>
        /// 数据源地址
        /// </summary>
        [Required]
        public string SourceAddress { get; set; }

        /// <summary>
        /// 数据类型
        /// </summary>
        [Required]
        public int DataTypeCode { get; set; }

        /// <summary>
        /// 数据分类
        /// </summary>
        [Required]
        public int DataCatalog { get; set; }

        /// <summary>
        /// 数据标签
        /// </summary>
        [Required]
        public int DataTag { get; set; }

        /// <summary>
        /// 数据名称
        /// </summary>
        [Required]
        public string DataName { get; set; }

        /// <summary>
        /// 参数所属设备
        /// </summary>
        [Required]
        public string DeviceCode { get; set; }

        /// <summary>
        /// 数据通道
        /// </summary>
        [Required]
        public string DataChannel { get; set; }

        /// <summary>
        /// 数据读写操作 0=不使用，1=ReadOnly; 2=WriteOnly; 3=ReadWrite; 4=Subscription
        /// </summary>
        [Required]
        public int DataAction { get; set; }

        /// <summary>
        /// 数据更新时间(ms)
        /// </summary>
        public int InternalTime { get; set; }

        /// <summary>
        /// 说明
        /// </summary>
        public string Description { get; set; }
    }
}
